﻿Public Class UserDAO
    Inherits EntityDAO

    Public Function getUserActions(ByVal userName As String)
        Try
            Dim ctx As SILM_GLOBAL = New SILM_GLOBAL(getConnectionString(Nothing, DatabaseType.TYPE_GLOBAL))

            Dim query = From user In ctx.Users _
        Join perm In ctx.Permissions On user.PermissionID Equals perm.PermissionID
        Join act In ctx.Actions On perm.PermissionID Equals act.permissionID
        Where user.UserName = userName
        Select action_name = act.action_name, _
        action_desc = act.action_desc

            Dim result = query.ToList()
            Return result
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        Return Nothing
    End Function
End Class
